

<!--头部区域-->
<?php include('./application/en/view/public/head.php') ?>
<link rel="stylesheet" href="_css/news.css"/>


<!--news-banner-->
<div class="comm-banner" style="background-image: url(<?php echo $navcate['img_url']?>);"></div>

<!--news-main-->
<div class="news-main bgcolor">

    <!--news-title-->
    <div class="news-title warper">
        <ul class="clearfix">
            <?php foreach ($newscatelist as $v){ ?>
            <li <?php if($thiscateid==$v['id']){ ?>class="active" <?php } ?>><a href="<?php echo url('news/index?cateid='.$v['id']) ?>"><?php echo $v['name'] ?></a></li>
                <?php if($thiscateid==$v['id']){ ?>
                    <input type="hidden" name="cateid" class="cateid" value="<?php echo $v['id'] ?>">
                <?php } ?>
            <?php } ?>
        </ul>
    </div>

    <div class="news-content warper">
        <ul class="clearfix">
            <?php foreach ($newslist as $v){ ?>
            <li>
                <a href="<?php echo url('news/detail?id='.$v['id']) ?>">
                    <img src="_images/news-01.png" alt="" width="336px" height="180px"/>
                    <div class="news-txt">
                        <h5><?php echo $v['title'] ?></h5>
                        <span>Time：<?php echo date('Y-m-d',strtotime($v['addtime'])) ?></span>
                        <p class="more-txt-cut"><?php echo msubstr($v['description'],0,200) ?></p>
                    </div>
                </a>
            </li>
            <?php } ?>

        </ul>
        <div class="jiazai-more">
            <a >More</a>
        </div>
    </div>

</div>

<!--PC尾部-->
<?php include('./application/en/view/public/foot.php') ?>

</body>
</html>
<script>
    $(function(){
        var page = 2;
        var is_ok = false;
        var cateid = $('.cateid').val();
        //alet()
        $('.jiazai-more a').click(function(){
            //alert(cateid);
            if(!is_ok){
                is_ok = true;
                $('.more').hide();
                $.ajax({
                    url: '/en/news/index_page.html',
                    type: 'post',
                    dataType: 'json',
                    data: {
                        page:page,
                        cateid:cateid
                    },
                    success: function (data) {
                        if(data.length){
                            $.each(data,function (k,v) {
                                var html='<li>'+
                                    '<a href="/en/news/detail/id/'+v['id']+'.html">' +
                                    '<img src="'+v['img_url']+'" alt="" width="336px" height="180px" />'+
                                        '<div class="news-txt">'+
                                        '<h5>'+v['title']+'</h5>'+
                                        '<span>Time：'+v['addtime'].substring(0,10) +'</span>'+
                                        ' <p class="more-txt-cut">'+ v['description']+'</p>'+
                                        '</div>'+
                                        '</a></li>';
                                $(".news-content .clearfix").append(html);
                            })
                            $('.jiazai-more').show();
                            is_ok = false;
                            page++;
                        }else{
                            alert('No More Data')
                        }
                    }
                })
            }
        })
    })

</script>
